<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta name="generator" content="PHPDoctor 2RC2 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Tue, 09 Dec 2008 09:11:43 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>ChangeSet (Moriarty)</title>

</head>
<body id="definition" onload="parent.document.title=document.title;">

<div class="header">
<h1>Moriarty</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../moriarty/package-summary.html">Package</a></li>
<li class="active">Class</li>
<li><a href="../moriarty/package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../moriarty/changeset.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<div class="qualifiedName">Moriarty.ChangeSet</div>

<h1>Class ChangeSet</h1>

<pre class="tree"><a href="../moriarty/simplegraph.html">SimpleGraph</a><br>  |<br>  +--<strong>ChangeSet</strong><br /></pre>

<hr>

<p class="signature">public  class <strong>ChangeSet</strong><br>extends <a href="../moriarty/simplegraph.html">SimpleGraph</a>

</p>

<div class="comment" id="overview_description"><p>
Represents a changeset. Can be used to create a changeset based on the difference between two bounded descriptions. The descriptions must share the same subject URI.</p></div>

<dl>
<dt>See Also:</dt>
<dd><a href="http://n2.talis.com/wiki/Changesets">http://n2.talis.com/wiki/Changesets</a></dd>
</dl>
<hr>

<table id="summary_constr">
<tr><th colspan="2">Constructor Summary</th></tr>
<tr>
<td class="description"><p class="name"><a href="#ChangeSet()">ChangeSet</a>(array args)</p><p class="description">
Create a new changeset. </p></td>
</tr>
</table>

<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type"> boolean</td>
<td class="description"><p class="name"><a href="#has_changes()">has_changes</a>()</p><p class="description">
Checks whether the changeset contains any additions or removals. </p></td>
</tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#include_addition()">include_addition</a>(array triple)</p><p class="description">
Include the supplied triple as an addition in the changeset.</p></td>
</tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#include_removal()">include_removal</a>(array triple)</p><p class="description">
Include the supplied triple as a removal in the changeset.</p></td>
</tr>
<tr>
<td class="type">private  void</td>
<td class="description"><p class="name"><a href="#init()">init</a>()</p></td>
</tr>
<tr>
<td class="type">protected  void</td>
<td class="description"><p class="name"><a href="#triple_in_list()">triple_in_list</a>(mixed triple, mixed list)</p></td>
</tr>
</table>

<table class="inherit">
<tr><th colspan="2">Methods inherited from Moriarty.SimpleGraph</th></tr>
<tr><td><a href="../moriarty/simplegraph.html#add_graph()">add_graph</a>, <a href="../moriarty/simplegraph.html#add_literal_triple()">add_literal_triple</a>, <a href="../moriarty/simplegraph.html#add_rdfxml()">add_rdfxml</a>, <a href="../moriarty/simplegraph.html#add_resource_triple()">add_resource_triple</a>, <a href="../moriarty/simplegraph.html#add_turtle()">add_turtle</a>, <a href="../moriarty/simplegraph.html#from_json()">from_json</a>, <a href="../moriarty/simplegraph.html#from_rdfxml()">from_rdfxml</a>, <a href="../moriarty/simplegraph.html#from_turtle()">from_turtle</a>, <a href="../moriarty/simplegraph.html#get_first_literal()">get_first_literal</a>, <a href="../moriarty/simplegraph.html#get_first_resource()">get_first_resource</a>, <a href="../moriarty/simplegraph.html#get_index()">get_index</a>, <a href="../moriarty/simplegraph.html#get_literal_triple_values()">get_literal_triple_values</a>, <a href="../moriarty/simplegraph.html#get_resource_triple_values()">get_resource_triple_values</a>, <a href="../moriarty/simplegraph.html#get_subject_property_values()">get_subject_property_values</a>, <a href="../moriarty/simplegraph.html#get_triples()">get_triples</a>, <a href="../moriarty/simplegraph.html#has_literal_triple()">has_literal_triple</a>, <a href="../moriarty/simplegraph.html#has_resource_triple()">has_resource_triple</a>, <a href="../moriarty/simplegraph.html#is_empty()">is_empty</a>, <a href="../moriarty/simplegraph.html#remove_all_triples()">remove_all_triples</a>, <a href="../moriarty/simplegraph.html#remove_property_values()">remove_property_values</a>, <a href="../moriarty/simplegraph.html#remove_resource_triple()">remove_resource_triple</a>, <a href="../moriarty/simplegraph.html#remove_triples_about()">remove_triples_about</a>, <a href="../moriarty/simplegraph.html#set_namespace_mapping()">set_namespace_mapping</a>, <a href="../moriarty/simplegraph.html#subject_has_property()">subject_has_property</a>, <a href="../moriarty/simplegraph.html#to_json()">to_json</a>, <a href="../moriarty/simplegraph.html#to_ntriples()">to_ntriples</a>, <a href="../moriarty/simplegraph.html#to_rdfxml()">to_rdfxml</a>, <a href="../moriarty/simplegraph.html#to_turtle()">to_turtle</a></td></tr></table>

<h2 id="detail_constr">Constructor Detail</h2>
<h3 id="ChangeSet()">ChangeSet</h3>
<code class="signature">public <strong>ChangeSet</strong>(array args)</code>
<div class="details">
<p>
Create a new changeset. This will calculate the required additions and removals based on before and after versions of a bounded description. The args parameter is an associative array that may have the following fields:
<ul>
  <li><em>subjectOfChange</em> => a string representing the URI of the changeset's subject of change</li>
  <li><em>createdDate</em> => a string representing the date of the changeset</li>
  <li><em>creatorName</em> => a string representing the creator of the changeset</li>
  <li><em>changeReason</em> => a string representing the reason for the changeset</li>
  <li><em>after</em> => an array of triples representing the required state of the resource description after the changeset would be applied. All subjects must be the same.</li>
  <li><em>before</em> => an array of triples representing the state of the resource description before the changeset is applied. All subjects must be the same.</li>
  <li><em>after_rdfxml</em> => a string of RDF/XML representing the required state of the resource description after the changeset would be applied. This is parsed and used to overwrite the 'after' parameter, if any. All subjects must be the same.</li>
  <li><em>before_rdfxml</em> => a string of RDF/XML representing the state of the resource description before the changeset is applied. This is parsed and used to overwrite the 'begin' parameter, if any. All subjects must be the same.</li>
</ul>
If none of 'after', 'before', 'after_rdfxml' or 'before_rdfxml' is supplied then an empty changeset is constructed. <br />
The 'after' and 'before' arrays are simple arrays where each element is a triple array with the following structure:
<ul>
  <li><em>s</em> => the subject URI</li>
  <li><em>p</em> => the predicate URI</li>
  <li><em>o</em> => the value of the object</li>
  <li><em>o_type</em> => one of 'uri', 'bnode' or 'literal'</li>
  <li><em>o_lang</em> => the language of the literal if any</li>
  <li><em>o_datatype</em> => the data type URI of the literal if any</li>
</ul></p><dl>
<dt>Parameters:</dt>
<dd>args - an associative array of parameters to use when constructing the changeset</dd>
</dl>
</div>

<hr>

<h2 id="detail_method">Method Detail</h2>
<h3 id="has_changes()">has_changes</h3>
<code class="signature">public  boolean <strong>has_changes</strong>()</code>
<div class="details">
<p>
Checks whether the changeset contains any additions or removals. Can be useful when deciding whether to submit the changeset or not.</p><dl>
<dt>Returns:</dt>
<dd>true if the changeset has changes to apply</dd>
</dl>
</div>

<hr>

<h3 id="include_addition()">include_addition</h3>
<code class="signature">public  void <strong>include_addition</strong>(array triple)</code>
<div class="details">
<p>
Include the supplied triple as an addition in the changeset.</p><dl>
<dt>Parameters:</dt>
<dd>triple - an array representing the triple to be added. The structure is as documented above.</dd>
</dl>
</div>

<hr>

<h3 id="include_removal()">include_removal</h3>
<code class="signature">public  void <strong>include_removal</strong>(array triple)</code>
<div class="details">
<p>
Include the supplied triple as a removal in the changeset.</p><dl>
<dt>Parameters:</dt>
<dd>triple - an array representing the triple to be removed. The structure is as documented above.</dd>
</dl>
</div>

<hr>

<h3 id="init()">init</h3>
<code class="signature">private  void <strong>init</strong>()</code>
<div class="details">
</div>

<hr>

<h3 id="triple_in_list()">triple_in_list</h3>
<code class="signature">protected  void <strong>triple_in_list</strong>(mixed triple, mixed list)</code>
<div class="details">
</div>

<hr>

<div class="header">
<h1>Moriarty</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../moriarty/package-summary.html">Package</a></li>
<li class="active">Class</li>
<li><a href="../moriarty/package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../moriarty/changeset.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://phpdoctor.sourceforge.net/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>